// components/dialog/dialog.js
Component({

    /**
     * 组件的属性列表
     */
    properties: {
        visible: {
            type: Boolean,
            value: false
        },
        title: {
            type: String,
            value: ""
        },
        context: {
            type: String,
            value: ""
        },
        cancel: {
            type: String,
            value: "取消"
        },
        btnText: {
            type: String,
            value: "确定"
        }
    },

    /**
     * 组件的初始数据
     */
    data: {

    },

    /**
     * 组件的方法列表
     */
    methods: {
        onVisibleChange() {
            this.setData({
                visible: false
            })
        },
        cancelTap() {
            this.setData({
                visible: false
            })
        },

        confirmTap() {
            this.setData({
                visible: false
            })

            this.triggerEvent('confirm');
        }
    }
})